<?php require_once '../util/verifyMenu.php';?>
<?php require_once '../util/verifyLogin.php';?>
<?php require_once '../util/header.php';?>
<body>
<div class="mycontent" align="center">
<img src="public/img/header.png" style="width: 1024px; margin: -6px;">
<?php require_once '../util/menu.php';?>
<div align="left">
&nbsp;&nbsp;&nbsp;ยอดซื้อ <b><?php echo $_SESSION['profit'];?></b> บาท&nbsp;&nbsp;&nbsp;
<input type="button" class="btn btn-info" value="ดูประวัติการซื้อ" style="margin-right: 20px;" onclick="javascript:location.href='../control/buydetailControl.php'">
<span style="float: right;">
สวัสดี คุณ <b><?php echo $_SESSION['name']." ".$_SESSION['lastname'];?></b>&nbsp;&nbsp;&nbsp;
<input type="button" class="btn" value="ออกจากระบบ" style="margin-right: 20px;" onclick="javascript:location.href='../util/logout.php'">
</span>
</div>
<h1>Edit Member</h1>
<hr>
<form name="frm" action="../control/editControl.php" method="post">
<?php 
	if(isset($_GET['err'])){
		echo "<span class='label label-warning'>Warning</span><br>";
		echo "<div style='width:50%;' class='alert alert-error'>เกิดข้อผิดพลาด  !</div>";
	}
?>
<table id="regis" cellspacing="5" cellpadding="10">
<tr>
<td>Username</td>
<td><input type="text" name="username" disabled value="<?php echo $_SESSION['username'];?>">&nbsp;&nbsp;</td>
</tr>
<tr>
<td>New Password</td>
<td><input type="password" name="password" ></td>
</tr>
<tr>
<td>Confirm New Password</td>
<td><input type="password" name="repassword" onkeyup="verifyPassword()">&nbsp;&nbsp;<span id="p_err"></span></td>
</tr>
<tr>
<td>Email</td>
<td><input type="email" name="email" disabled value="<?php echo $_SESSION['email'];?>"></td>
</tr>
<tr>
<td>ชื่อ</td>
<td><input type="text" name="name" value="<?php echo $_SESSION['name'];?>"></td>
</tr>
<tr>
<td>นามสกุล</td>
<td><input type="text" name="lastname" value="<?php echo $_SESSION['lastname'];?>"></td>
</tr>
<tr>
<td>หมายเลขบัตรประชาชน</td>
<td><input type="text" name="idcard" maxlength="13" onblur="verifyIdCard()" disabled value="<?php echo $_SESSION['idcard'];?>">&nbsp;&nbsp;<span id="i_err"></span></td>
</tr>
</table>
<br><br>
<input type="submit" class="btn btn-primary" value="Edit">
<input type="reset" class="btn" value="Reset">
</form>
<?php require_once '../util/footer.php';?>
</div>
</body>
